import http from "@/api/http";

export function getTree() {
  return http.get({
    url: "/system/menu/tree"
  });
}

export function getMenu(id: number) {
  return http.get({
    url: "/system/menu/" + id
  });
}

export function getMenuByRoleId(id: number) {
  return http.get({
    url: "/system/menu/role/" + id
  });
}

export function saveMenu(obj: any) {
  return http.post({
    url: "/system/menu",
    data: obj
  });
}

export function updateMenu(obj: any) {
  return http.put({
    url: "/system/menu",
    data: obj
  });
}

export function delMenu(id: number) {
  return http.delete({
    url: "/system/menu/" + id
  });
}
